package com.example.springboot.test;

import com.example.springboot.pojo.Demo;
import com.example.springboot.service.ServiceDemo;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;


@RestController//表示访问这个地址时要返回一个字符串
public class DemoController {

    @Resource
    private ServiceDemo serviceDemo;
    @GetMapping("/demo/service")
    public List<Demo> list(){
        return serviceDemo.list();
    }

}
